<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>查看数据</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css" media="all">
</head>

<body>

    <form class="layui-form" lay-filter="example">

        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">评论编号:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="commentId" disabled="true" autocomplete="off" placeholder="" id="commentId"
                    class="layui-input">
            </div>
        </div>

        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">评论标题:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="commentTitle" lay-verify="title" autocomplete="off" placeholder=""
                    disabled="true" id="commentTitle" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">评论用户:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="userName" lay-verify="title" autocomplete="off" placeholder="" disabled="true"
                    id="userName" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">评论电影:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="movieName" lay-verify="title" autocomplete="off" placeholder="" disabled="true"
                    id="movieName" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">评论评分:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="commentScore" lay-verify="title" autocomplete="off" placeholder="" disabled="true"
                    id="commentScore" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="margin-top: 20px">
            <label class="layui-form-label">评论时间:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="commentTime" lay-verify="title" autocomplete="off" placeholder=""
                    disabled="true" id="commentTime" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">点赞数目:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="commentPraise" lay-verify="required" placeholder="" disabled=" true"
                    id="commentPraise" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">评论内容:</label>
            <div class="layui-input-block" style="margin-right: 20px">
                <input type="text" name="commentCom" lay-verify="required" placeholder="" disabled=" true"
                    id="commentCom" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">评论图片:</label>
            <div class="layui-input-block" style="margin-right: 20px" id="commentImgList">

            </div>
        </div>


    </form>

    <style>
        #commentImgList img {
            margin: 5px;
        }
    </style>
    <script src="../../assets/libs/layui/layui.js" charset="utf-8"></script>
    <script src="../js/util.js" charset="utf-8"></script>
    <script>



        layui.config({
            base: '/module/'
        }).use(['jquery', 'layer', 'table', 'form', 'config'], function () {
            var $ = layui.jquery;
            var layer = layui.layer;
            var table = layui.table;
            var form = layui.form;
            var config = layui.config;
            var req = GetRequest();

            var no = req['editNo'];
            $.ajax({
                url: config.base_server + 'GetcommentById?editNo=' + no,
                dataType: 'json',
                type: 'get',
                success: function (data) {
                    data = data.data;
                    console.log(data)
                    $('#commentId').val(data[0].commentId);
                    $('#commentTitle').val(data[0].commentTitle);
                    $('#userName').val(data[0].userName);
                    $('#commentScore').val(data[0].commentScore);
                    $('#movieName').val(data[0].movieName);
                    $('#commentPraise').val(data[0].commentPraise);
                    $('#commentTime').val(data[0].commentTime);
                    $('#commentCom').val(data[0].commentCom);
                    (data[0].commentImgList).forEach(item => {
                        $('#commentImgList').append('<img  src="' + item + '" alt="" srcset="" disabled="true" name="commentImg" id="commentImg" width="100" height="100" />');
                    })
                }
            })
        });
    </script>
</body>